<?php

	require_once("action/CommonAction.php");
	
	class IndexAction extends CommonAction {
		
		public function __construct() {
			parent::__construct(CommonAction::$VISIBILITY_PUBLIC);	
		}	
	
		public function executeAction() {
			
			if (isset($_POST["username"])) {
				$valid = UserDAO::authenticate($_POST["username"]);
				
				if ($valid) {
					$_SESSION["visibility"] = CommonAction::$VISIBILITY_MEMBER;
					header("location:home.php");
				}
			}
		}
	}